package com.SpringDruid.task;

import com.SpringDruid.mapper.Test2Mapper;
import com.SpringDruid.mapper.TestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework. stereotype.Component;

@EnableScheduling
@Component
public class TestTask {

    @Autowired
    private TestMapper testMapper;
    @Autowired
    private Test2Mapper test2Mapper;

    @Scheduled(cron = "0/1 * * * * ?")
    public void task1() {
        testMapper.query();
    }

//    @Scheduled(cron = "0/1 * * * * ?")
//    @DataSource("postgresql")
//    public void task2() {
//        testMapper.query();
//    }
}
